<?php
// +----------------------------
// | Created by PhpStorm
// +----------------------------
// | Author: YnnSon
// +----------------------------
namespace app\api\validate;

/**
 * 参数必须是正整数
 * Class ParameterMustBePositiveInteger
 * @package app\api\validate
 */
class ParameterMustBePositiveInteger extends BaseValidate
{
    protected $rule = [
        ['id', 'require|isPositiveInteger', 'ID不存在|ID必须为正整数'],
        ['type', 'require|number', '类型不存在|类型必须为数字'],
        ['page', 'require|isPositiveInteger', '页码不存在|分页数量必须为正整数'],
        ['status', 'require', '参数必须'],
        ['reback_case', 'require', '退款原因不能为空'],
    ];
    // 验证场景
    protected $scene = [
        'id'           => ['id'], // ID
        'sysmsg'       => ['type', 'page'], // 获取系统消息
        'order'        => ['status', 'page'], // 获取订单列表
        'refund'       => ['page'], // 获取退款订单
        'refundStatus' => ['id', 'reback_case'], // 更新退款订单
    ];
}